package com.dogkr.server.entity;

import java.util.Date;
import java.util.List;

public class User {
	
	public static short STATUS_DISABLE = 1;
	public static short STATUS_NORMAL = 300;
	public static short STATUS_MANAGER = 400;
	
    private Long id;

    private String loginName;

    private String loginPassword;

    private String userName;

    private String userNickName;

    private String userEmail;

    private String userTel;

    private Short userSex;

    private Date userBirthday;

    private Short userCardtype;

    private String userCard;

    private Integer userLng;

    private Integer userLat;

    private Date lastLogindate;

    private Date lastModifydate;

    private Date createDate;

    private Short status;

    private String userPhotoPath;

    private String remark;
    
    private Host host;
    
    private HostApply hostApply;
    
    private List<UserPet> userPetList;
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getLoginPassword() {
        return loginPassword;
    }

    public void setLoginPassword(String loginPassword) {
        this.loginPassword = loginPassword;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserNickName() {
        return userNickName;
    }

    public void setUserNickName(String userNickName) {
        this.userNickName = userNickName;
    }

    public String getUserEmail() {
        return userEmail;
    }

    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    public String getUserTel() {
        return userTel;
    }

    public void setUserTel(String userTel) {
        this.userTel = userTel;
    }

    public Short getUserSex() {
        return userSex;
    }

    public void setUserSex(Short userSex) {
        this.userSex = userSex;
    }

    public Date getUserBirthday() {
        return userBirthday;
    }

    public void setUserBirthday(Date userBirthday) {
        this.userBirthday = userBirthday;
    }

    public Short getUserCardtype() {
        return userCardtype;
    }

    public void setUserCardtype(Short userCardtype) {
        this.userCardtype = userCardtype;
    }

    public String getUserCard() {
        return userCard;
    }

    public void setUserCard(String userCard) {
        this.userCard = userCard;
    }

    public Integer getUserLng() {
        return userLng;
    }

    public void setUserLng(Integer userLng) {
        this.userLng = userLng;
    }

    public Integer getUserLat() {
        return userLat;
    }

    public void setUserLat(Integer userLat) {
        this.userLat = userLat;
    }

    public Date getLastLogindate() {
        return lastLogindate;
    }

    public void setLastLogindate(Date lastLogindate) {
        this.lastLogindate = lastLogindate;
    }

    public Date getLastModifydate() {
        return lastModifydate;
    }

    public void setLastModifydate(Date lastModifydate) {
        this.lastModifydate = lastModifydate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Short getStatus() {
        return status;
    }

    public void setStatus(Short status) {
        this.status = status;
    }

    public String getUserPhotoPath() {
        return userPhotoPath;
    }

    public void setUserPhotoPath(String userPhotoPath) {
        this.userPhotoPath = userPhotoPath;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

	public Host getHost() {
		return host;
	}

	public void setHost(Host host) {
		this.host = host;
	}

	public List<UserPet> getUserPetList() {
		return userPetList;
	}

	public void setUserPetList(List<UserPet> userPetList) {
		this.userPetList = userPetList;
	}

	public HostApply getHostApply() {
		return hostApply;
	}

	public void setHostApply(HostApply hostApply) {
		this.hostApply = hostApply;
	}

	public void updateInfo(User user) {
		this.id = user.getId();
		this.userNickName = user.getUserNickName();
		this.userName = user.getUserName();
		this.userSex = user.getUserSex();
		this.userTel = user.getUserTel();
		this.userEmail = user.getUserEmail();
		this.userBirthday = user.getUserBirthday();
		this.userCard = user.getUserCard();
		this.lastLogindate = new Date();
	}

	public Host createHost(HostApply apply) {
		Host host = new Host();
		host.setUserId(apply.getUserId());
		host.setCreateDate(new Date());
		host.setStatus(Host.STATUS_NEW);
		return host;
	}
}